#ifndef __STANDARD_EXCEPTION__
#define __STANDARD_EXCEPTION__

#include <string>

enum STANDARD_EXCEPTIONS {
    STANDARD_SUCC = 0,
    STANDARD_NO_MEM,
    STANDARD_WRITE_UNABLE,
    STANDARD_READ_UNABLE,
    STANDARD_INVALID_XML,
    STANDARD_NO_OPENCL_PLATFORM,
    STANDARD_NO_OPENCL_DEVICE,
    STANDARD_OUT_OF_BOUNDS,
    STANDARD_IMAGE_NOT_SUPPORTED_ON_DEVICE,
    STANDARD_NOT_SUPPORTED_DEVICE,
    STANDARD_INVALID_IMAGE_FORMAT,
    STANDARD_DIFFERENT_IMAGES_SIZES,
    STANDARD_NO_MODEL_LOADED,
    STANDARD_INALID_SVM_TYPE,
    STANDARD_INVALID_KERNEL_TYPE,
    STANDARD_CANT_GET_PARAMETERS,
    STANDARD_CANT_PREDICT,
    STANDARD_OPENCL_TOOLS_NOT_INITIALIZED,
    STANDARD_NOT_INITIALIZED_BY_MENAGER_OR_DELETED,
    STANDARD_CANT_ADD_TO_MEM_MENAGER,
    STANDARD_NULL_POINTER,
    STANDARD_NOT_FOUND_PROPERTY,
    STANDARD_CLASS_NOT_REGISTRETED,
    STANDARD_OTHER,
};

static std::string ExceptionStrings[] = {
    "STANDARD_SUCC",
    "STANDARD_NO_MEM",
    "STANDARD_WRITE_UNABLE",
    "STANDARD_READ_UNABLE",
    "STANDARD_INVALID_XML",
    "STANDARD_NO_OPENCL_PLATFORM",
    "STANDARD_NO_OPENCL_DEVICE",
    "STANDARD_OUT_OF_BOUNDS",
    "STANDARD_IMAGE_NOT_SUPPORTED_ON_DEVICE",
    "STANDARD_NOT_SUPPORTED_DEVICE",
    "STANDARD_INVALID_IMAGE_FORMAT",
    "STANDARD_DIFFERENT_IMAGES_SIZES",
    "STANDARD_NO_MODEL_LOADED",
    "STANDARD_INALID_SVM_TYPE",
    "STANDARD_INVALID_KERNEL_TYPE",
    "STANDARD_CANT_GET_PARAMETERS",
    "STANDARD_CANT_PREDICT",
    "STANDARD_OPENCL_TOOLS_NOT_INITIALIZED",
    "STANDARD_NOT_INITIALIZED_BY_MENAGER_OR_DELETED",
    "STANDARD_CANT_ADD_TO_MEM_MENAGER",
    "STANDARD_NULL_POINTER",
    "STANDARD_NOT_FOUND_PROPERTY",
    "STANDARD_CLASS_NOT_REGISTRETED",
    "STANDARD_OTHER"
};

namespace core {
    namespace exceptions {

        class StandardException : public std::exception {
        private:
            STANDARD_EXCEPTIONS excCode;
            std::string location;

            StandardException();
        protected:
        public:

            virtual ~StandardException();

            StandardException(STANDARD_EXCEPTIONS code, std::string location);

            virtual const char* what() const throw ();

            std::string handleException();
            
        };
        
    }
}

#endif